"""
Imports the proper JSON library for the current Python version.
This module is here mainly to help integrators stay sane.
"""
JSON_LIBRARY = None
INDENT=2
try:
    import json
    JSON_LIBRARY = 'python'
except:
    pass

if JSON_LIBRARY is None:
    try:   
        import simplejson as json
        JSON_LIBRARY = 'simplejson'
        # simplejson actually wants the whole string
        INDENT=' ' * INDENT
    except:
        pass
        
if JSON_LIBRARY is None:
    raise Exception(
        'No suitable JSON library was found. '
        'See documentation for more information.'
        )
